fix(app-shell): send current-page object to the AI assistant context#1698
Merged
Conversation
The floating console assistant only forwarded appName + the full objects list, never the object the user is actually viewing. So asking it to "analyse this object" (especially in a non-English prompt) gave the agent nothing to anchor on and it replied that it couldn't find the object. Derive the current object/record from the route (mirroring useTrackRouteAsRecent's URL layout, tolerant of a `_console` shell prefix) and pass them as context.objectName / context.recordId. The backend then injects that object's schema into the system prompt and scopes data queries to it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The floating console assistant forwarded
appName+ the fullobjectslist but never the object the user is actually viewing. So asking it to analyse this object (especially in a non-English prompt) gave the agent nothing to anchor on, and it replied that it couldn't find the object.Change
ConsoleFloatingChatbotnow derives the current object/record from the route — mirroringuseTrackRouteAsRecent's URL layout (/apps/:appName/:objectName[/:recordId]), tolerant of a_consoleshell prefix and validated against the app's object list — and passes them ascontext.objectName/context.recordId.The backend (framework PR #1815) uses these to inject the object's schema into the system prompt and scope data queries to it, so "analyse this object" works without the user naming it.
Object routes only — dashboard/page/report/metadata segments and the
newrecord route are excluded, so the designereditingcontext is unaffected.Notes
Per-request
bodyis rebuilt each render (it's in the transportuseMemodeps), so navigating between objects updatesobjectNameon the next message.🤖 Generated with Claude Code